package com.atguigu.common.exception;

/*
* 10通用
*   001参数格式校验异常
*   002短信发送太频繁，请稍后再试
* 11：商品
* 12：订单
* 13：购物车
* 14：物流
* 15: 用户
* 16: 库存
* */
public enum BizCodeEnum {
    UNKNOW_EXCEPTION(10000,"系统未知异常"),
    VALID_EXCEPTION(10001,"参数格式校验失败"),
    SEND_MESSAGE_ERROR(10002,"短信发送太频繁，请稍后再试"),
    TOO_MANY_REQUEST(10003,"太多的请求"),
    PHONE_NOT_UNIQUE_EXCEPTION(15001,"手机号已经被注册"),
    USERNAME_NOT_UNIQUE_EXCEPTION(15002,"用户名已经被注册"),
    USERNAME_PASSWORD_INVALID_EXCEPTION(15003,"账号或密码错误"),
    WARE_NO_STOCK_EXCEPTION(16001,"库存不足，请重新下单");
    private int code;
    private String message;

    BizCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
